#pragma once
#include<math.h>                                         // Math header file.


class TexCoord
{
   public:
      TexCoord()
         {
            tu = 0.0f; tv = 0.0f;
         }

      TexCoord(float u, float v)
         {
            tu = u; tv = v;
         }

      float tu, tv;                                      // Set of texture coordinates.
};


class Vector3D
{
   public:
      Vector3D();                                        // Constructor.
      Vector3D(float X, float Y, float Z);               // Overloaded constructor.
      Vector3D(float X, float Y, float Z, float W);      // Overloaded constructor again.
      Vector3D(const Vector3D &v);                       // Another overloaded constructor.

      void operator=(Vector3D v);                        // Overloaded = sign.
      Vector3D operator-(Vector3D v);                    // Overloaded - sign.
      Vector3D operator+(Vector3D v);                    // Overloaded + sign.
      Vector3D operator*(Vector3D v);                    // Overloaded * sign.
      Vector3D operator/(Vector3D v);                    // Overloaded / sign.
      Vector3D operator+(float f);                       // Overloaded + sign.
      Vector3D operator-(float f);                       // Overloaded - sign.
      Vector3D operator*(float f);                       // Overloaded * sign.
      Vector3D operator/(float f);                       // Overloaded / sign.

      void operator +=(Vector3D v);                      // Overloaded += sign.
      void operator -=(Vector3D v);                      // Overloaded -= sign.
      void operator *=(Vector3D v);                      // Overloaded *= sign.
      void operator /=(Vector3D v);                      // Overloaded /= sign.
      void operator +=(float f);                         // Overloaded += sign.
      void operator -=(float f);                         // Overloaded -= sign.
      void operator *=(float f);                         // Overloaded *= sign.
      void operator /=(float f);                         // Overloaded /= sign.

      bool operator ==(Vector3D v);                      // Overloaded == sign.
      bool operator !=(Vector3D v);                      // Overloaded != sign.

      void CrossProduct(Vector3D v1, Vector3D v2);       // Stores cross product of v1, v2.
      void CrossProduct3(Vector3D v1, Vector3D v2,
                         Vector3D v3);                   // Stores cross product of v1, v2, v3.
      float DotProduct3(Vector3D v1);                    // Dot 3 on v1 and this.
      float DotProduct4(Vector3D v1);                    // Returns dot product 4 of v1 and this.
      float GetLength();                                 // Return this objects length.
      void Normal();                                     // Normalize this vector.
      void Normalize(Vector3D Triangle[]);               // Find the normal of a triangle.
      void CalculateTangentVector(Vector3D Point1,
                                  Vector3D Point2,
                                  Vector3D Point3,
                                  Vector3D NormalOfA,
                                  TexCoord P1Tex,
                                  TexCoord P2Tex,
                                  TexCoord P3Tex);      // Cacluate a tagent vector & store here.
      void ExtendVertexPos(Vector3D lightPos,            // Extend point based on light position
                           float Extend);                // and currend point, saves here.
      void ExtendVertexPos(Vector3D currentVertex,       // Takes current point and source and
                           Vector3D lightPos,            // extend and saves here.
                           float Extend);
      Vector3D GetRotatedX(double angle);                // Rotate along x.
      Vector3D GetRotatedY(double angle);                // Rotate alone y.
      Vector3D GetRotatedZ(double angle);                // Rotate along z.
      Vector3D GetRotatedAxis(double angle, Vector3D axis);// Rotate along an axis.
      void CalculateBinormalVector(Vector3D tangent,
                                   Vector3D normal);     // Calcluate a binormal.
      void ClampTo01();                                  // Clamp this vector between 0 and 1.


      float x, y, z, w;                                  // vertex's x, y, and z info.
};